#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    srand(time(0));
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_agree_clicked()
{
    ui->label->setText("来快点跟我亲亲吧~~~~~~~~");
}

// 点击又松开鼠标
void Widget::on_pushButton_reject_clicked()
{
//    // 获取当前窗口的长和宽
//    int width = this->x();
//    int height = this->y();

//    // 获取随机长和宽
//    int x = rand() % width;
//    int y = rand() % height;

//    ui->pushButton_reject->move(x, y);
}

// 点击鼠标
void Widget::on_pushButton_reject_pressed()
{
    // 获取当前窗口的长和宽
    int width = this->x();
    int height = this->y();

    // 获取随机长和宽
    int x = rand() % width;
    int y = rand() % height;

    ui->pushButton_reject->move(x, y);
}
